<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>主题</title>
</head>
<body>
<img width="400" id="img" src="img/1001583.jpg"><br>
<button id="up" onclick="fun1()">上一张</button>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<button id="down" onclick="fun2()">下一张</button>
</body>
<script>
    function fun1() {
        let img = document.getElementById("img");
        img.setAttribute("src","img/1001583.jpg")
    }

    function fun2() {
        let img = document.getElementById("img");
        img.setAttribute("src","img/309322.jpg")
    }

</script>
</html>